<!--
 * @Author: wangming
 * @Date: 2021-11-04 09:41:49
 * @LastEditors: wangming
 * @LastEditTime: 2022-08-03 10:25:05
 * @FilePath: /hanma-paas-fed/Users/wm/瀚川/hanma-application-designer-fed/src/pageComponents/main/previewTemplate/drawer.vue
 * @Description: 
-->
<template>
  <el-drawer
    :direction="direction"
    :wrapperClosable="closeOnModal"
    :title="name"
    :visible="visible"
    :size="width"
    @close="close"
  >
    <div class="b g3 f16 tl" slot="title">
      <span>{{ name }}</span>
    </div>
    <div class="pl10 pr10">
      <slot></slot>
    </div>
  </el-drawer>
</template>

<script>
export default {
  props: ["visible", "width", "name", "direction", "closeOnModal"],
  methods: {
    close() {
      if (this.visible) {
        this.$emit("closeModel");
      }
      this.$emit("update:visible", false);
    },
  },
};
</script>

<style scoped lang="scss">
</style>
